///*
// * Copyright (c) 2016 咖枯 <kaku201313@163.com | 3772304@qq.com>
// *
// * Licensed under the Apache License, Version 2.0 (the "License");
// * you may not use this file except in compliance with the License.
// * You may obtain a copy of the License at
// *
// *     http://www.apache.org/licenses/LICENSE-2.0
// *
// * Unless required by applicable law or agreed to in writing, software
// * distributed under the License is distributed on an "AS IS" BASIS,
// * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// * See the License for the specific language governing permissions and
// * limitations under the License.
// *
// */
//package android07.newtop.fragment;
//
//import android.app.Activity;
//import android.content.SharedPreferences;
//import android.graphics.drawable.Drawable;
//import android.os.Bundle;
//import android.os.Handler;
//import android.os.SystemClock;
//import android.support.v4.widget.SwipeRefreshLayout;
//import android.view.LayoutInflater;
//import android.view.View;
//import android.view.ViewGroup;
//import android.view.ViewStub;
//import android.widget.ImageView;
//import android.widget.LinearLayout;
//import android.widget.RelativeLayout;
//import android.widget.TextView;
//
//import com.jude.beam.bijection.RequiresPresenter;
//import com.jude.beam.expansion.data.BeamDataFragment;
//
//import java.util.Calendar;
//import java.util.List;
//
//import android07.newtop.R;
//import android07.newtop.app.WeacConstants;
//import android07.newtop.model.bean.WeatherInfoBean;
//import android07.newtop.presenter.WeaFragmentPresenter;
//import android07.newtop.utils.MyUtil;
//import android07.newtop.view.LineChartViewDouble;
//import android07.newtop.view.RichDrawableText;
//
///**
//
// */
//@RequiresPresenter(WeaFragmentPresenter.class)
//public class WeaFragmentBackup extends BeamDataFragment<WeaFragmentPresenter,WeatherInfoBean> {
//    /**
//     * Log tag ：WeaFragment
//     */
//    private static final String LOG_TAG = "WeaFragment";
//
//    /**
//     * 天气的requestCode
//     */
//    private static final int REQUEST_WEA = 1;
//
//    /**
//     * 城市名
//     */
//   // private TextView mCityNameTv;
//
//    /**
//     * 警报
//     */
//    private TextView mAlarmTv;
//
//    /**
//     * 更新时间
//     */
//    private TextView mUpdateTimeTv;
//
//
//    /**
//     * 温度1
//     */
//    private ImageView mTemperature1Iv;
//
//    /**
//     * 温度2
//     */
//    private ImageView mTemperature2Iv;
//
//    /**
//     * 温度3
//     */
//    private ImageView mTemperature3Iv;
//
//    /**
//     * 天气类型
//     */
//    private TextView mWeatherTypeTv;
//
//
//    /**
//     * 大气环境
//     */
//    private RichDrawableText mAqiTv;
//
//    /**
//     * 湿度
//     */
//    private RichDrawableText mHumidityTv;
//
//    /**
//     * 风向、风力
//     */
//    private RichDrawableText mWindTv;
//
//
//    /**
//     * 今天天气类型图片
//     */
//    private ImageView mWeatherTypeIvToday;
//
//    /**
//     * 今天高温
//     */
//    private TextView mTempHighTvToday;
//
//    /**
//     * 今天低温
//     */
//    private TextView mTempLowTvToday;
//
//    /**
//     * 今天天气类型文字
//     */
//    private TextView mWeatherTypeTvToday;
//
//
//    /**
//     * 明天天气类型图片
//     */
//    private ImageView mWeatherTypeIvTomorrow;
//
//    /**
//     * 明天高温
//     */
//    private TextView mTempHighTvTomorrow;
//
//    /**
//     * 明天低温
//     */
//    private TextView mTempLowTvTomorrow;
//
//    /**
//     * 明天天气类型文字
//     */
//    private TextView mWeatherTypeTvTomorrow;
//
//
//    /**
//     * 后天天气类型图片
//     */
//    private ImageView mWeatherTypeIvDayAfterTomorrow;
//
//    /**
//     * 后天高温
//     */
//    private TextView mTempHighTvDayAfterTomorrow;
//
//    /**
//     * 后天低温
//     */
//    private TextView mTempLowTvDayAfterTomorrow;
//
//    /**
//     * 后天天气类型文字
//     */
//    private TextView mWeatherTypeTvDayAfterTomorrow;
//
//
////    /**
////     * 多天预报标题1
////     */
////    private TextView mDaysForecastTvWeek1;
//
//    /**
//     * 多天预报标题2
//     */
//    private TextView mDaysForecastTvWeek2;
//
//    /**
//     * 多天预报标题3
//     */
//    private TextView mDaysForecastTvWeek3;
//
//    /**
//     * 多天预报标题4
//     */
//    private TextView mDaysForecastTvWeek4;
//
//    /**
//     * 多天预报标题5
//     */
//    private TextView mDaysForecastTvWeek5;
//
//    /**
//     * 多天预报标题6
//     */
//    private TextView mDaysForecastTvWeek6;
//
//
////    /**
////     * 多天预报日期1
////     */
////    private TextView mDaysForecastTvDay1;
//
//    /**
//     * 多天预报日期2
//     */
//    private TextView mDaysForecastTvDay2;
//
//    /**
//     * 多天预报日期3
//     */
//    private TextView mDaysForecastTvDay3;
//
//    /**
//     * 多天预报日期4
//     */
//    private TextView mDaysForecastTvDay4;
//
//    /**
//     * 多天预报日期5
//     */
//    private TextView mDaysForecastTvDay5;
//
//    /**
//     * 多天预报日期6
//     */
//    private TextView mDaysForecastTvDay6;
//
////
////    /**
////     * 多天预报白天天气类型图片1
////     */
////    private ImageView mDaysForecastWeaTypeDayIv1;
//
//    /**
//     * 多天预报白天天气类型图片2
//     */
//    private ImageView mDaysForecastWeaTypeDayIv2;
//
//    /**
//     * 多天预报白天天气类型图片3
//     */
//    private ImageView mDaysForecastWeaTypeDayIv3;
//
//    /**
//     * 多天预报白天天气类型图片4
//     */
//    private ImageView mDaysForecastWeaTypeDayIv4;
//
//    /**
//     * 多天预报白天天气类型图片5
//     */
//    private ImageView mDaysForecastWeaTypeDayIv5;
//
//    /**
//     * 多天预报白天天气类型图片6
//     */
//    private ImageView mDaysForecastWeaTypeDayIv6;
//
//
////    /**
////     * 多天预报白天天气类型文字1
////     */
////    private TextView mDaysForecastWeaTypeDayTv1;
//
//    /**
//     * 多天预报白天天气类型文字2
//     */
//    private TextView mDaysForecastWeaTypeDayTv2;
//
//    /**
//     * 多天预报白天天气类型文字3
//     */
//    private TextView mDaysForecastWeaTypeDayTv3;
//
//    /**
//     * 多天预报白天天气类型文字4
//     */
//    private TextView mDaysForecastWeaTypeDayTv4;
//
//    /**
//     * 多天预报白天天气类型文字5
//     */
//    private TextView mDaysForecastWeaTypeDayTv5;
//
//    /**
//     * 多天预报白天天气类型文字6
//     */
//    private TextView mDaysForecastWeaTypeDayTv6;
//
//
//    /**
//     * 温度曲线
//     */
//    private LineChartViewDouble mCharView;
//
//
////    /**
////     * 多天预报夜间天气类型图片1
////     */
////    private ImageView mDaysForecastWeaTypeNightIv1;
//
//    /**
//     * 多天预报夜间天气类型图片2
//     */
//    private ImageView mDaysForecastWeaTypeNightIv2;
//
//    /**
//     * 多天预报夜间天气类型图片3
//     */
//    private ImageView mDaysForecastWeaTypeNightIv3;
//
//    /**
//     * 多天预报夜间天气类型图片4
//     */
//    private ImageView mDaysForecastWeaTypeNightIv4;
//
//    /**
//     * 多天预报夜间天气类型图片5
//     */
//    private ImageView mDaysForecastWeaTypeNightIv5;
//
//    /**
//     * 多天预报夜间天气类型图片6
//     */
//    private ImageView mDaysForecastWeaTypeNightIv6;
//
//
////    /**
////     * 多天预报夜间天气类型文字1
////     */
////    private TextView mDaysForecastWeaTypeNightTv1;
//
//    /**
//     * 多天预报夜间天气类型文字2
//     */
//    private TextView mDaysForecastWeaTypeNightTv2;
//
//    /**
//     * 多天预报夜间天气类型文字3
//     */
//    private TextView mDaysForecastWeaTypeNightTv3;
//
//    /**
//     * 多天预报夜间天气类型文字4
//     */
//    private TextView mDaysForecastWeaTypeNightTv4;
//
//    /**
//     * 多天预报夜间天气类型文字5
//     */
//    private TextView mDaysForecastWeaTypeNightTv5;
//
//    /**
//     * 多天预报夜间天气类型文字6
//     */
//    private TextView mDaysForecastWeaTypeNightTv6;
//
////
////    /**
////     * 多天预报风向1
////     */
////    private TextView mDaysForecastWindDirectionTv1;
//
//    /**
//     * 多天预报风向2
//     */
//    private TextView mDaysForecastWindDirectionTv2;
//
//    /**
//     * 多天预报风向3
//     */
//    private TextView mDaysForecastWindDirectionTv3;
//
//    /**
//     * 多天预报风向4
//     */
//    private TextView mDaysForecastWindDirectionTv4;
//
//    /**
//     * 多天预报风向5
//     */
//    private TextView mDaysForecastWindDirectionTv5;
//
//    /**
//     * 多天预报风向6
//     */
//    private TextView mDaysForecastWindDirectionTv6;
//
//
////    /**
////     * 多天预报风力1
////     */
////    private TextView mDaysForecastWindPowerTv1;
//
//    /**
//     * 多天预报风力2
//     */
//    private TextView mDaysForecastWindPowerTv2;
//
//    /**
//     * 多天预报风力3
//     */
//    private TextView mDaysForecastWindPowerTv3;
//
//    /**
//     * 多天预报风力4
//     */
//    private TextView mDaysForecastWindPowerTv4;
//
//    /**
//     * 多天预报风力5
//     */
//    private TextView mDaysForecastWindPowerTv5;
//
//    /**
//     * 多天预报风力6
//     */
//    private TextView mDaysForecastWindPowerTv6;
//
//
//    /**
//     * 雨伞指数TextView
//     */
//    private TextView mLifeIndexUmbrellaTv;
//
//    /**
//     * 紫外线指数TextView
//     */
//    private TextView mLifeIndexUltravioletRaysTv;
//
//    /**
//     * 穿衣指数TextView
//     */
//    private TextView mLifeIndexDressTv;
//
//    /**
//     * 感冒指数TextView
//     */
//    private TextView mLifeIndexColdTv;
//
//    /**
//     * 晨练指数TextView
//     */
//    private TextView mLifeIndexMorningExerciseTv;
//
//    /**
//     * 运动指数TextView
//     */
//    private TextView mLifeIndexSportTv;
//
//    /**
//     * 洗车指数TextView
//     */
//    private TextView mLifeIndexCarWashTv;
//
//    /**
//     * 晾晒指数TextView
//     */
//    private TextView mLifeIndexAirCureTv;
//
//
//    /**
//     * 雨伞指数详细
//     */
//    private String mLifeIndexUmbrellaDetail;
//
//    /**
//     * 紫外线指数详细
//     */
//    private String mLifeIndexUltravioletRaysDetail;
//
//    /**
//     * 穿衣指数详细
//     */
//    private String mLifeIndexDressDetail;
//
//    /**
//     * 感冒指数详细
//     */
//    private String mLifeIndexColdDetail;
//
//    /**
//     * 晨练指数详细
//     */
//    private String mLifeIndexMorningExerciseDetail;
//
//    /**
//     * 运动指数详细
//     */
//    private String mLifeIndexSportDetail;
//
//    /**
//     * 洗车指数详细
//     */
//    private String mLifeIndexCarWashDetail;
//
//    /**
//     * 晾晒指数详细
//     */
//    private String mLifeIndexAirCureDetail;
//
////    /**
////     * 下拉刷新ScrollView
////     */
////    public PullToRefreshScrollView mPullRefreshScrollView;
//
//    /**
//     * 刷新按钮
//     */
//    public ImageView mRefreshBtn;
//
//    /**
//     * 延迟刷新线程是否已经启动
//     */
//    public boolean mIsPostDelayed;
//
//    /**
//     * 延迟刷新Handler
//     */
//    public Handler mHandler;
//
//    /**
//     * 延迟刷新Runnable
//     */
//    public Runnable mRun;
//
//    /**
//     * 标志位，标志已经初始化完成
//     */
//    private boolean mIsPrepared;
//
//    /**
//     * 上次主动更新时间
//     */
//    private long mLastActiveUpdateTime;
//
//    /**
//     * 设置壁纸
//     */
//    private LinearLayout mBackGround;
//
//    /**
//     * 模糊处理过的Drawable
//     */
//    private Drawable mBlurDrawable;
//
//    /**
//     * 屏幕密度
//     */
//    private float mDensity;
//
//    /**
//     * 透明
//     */
//    private int mAlpha = 0;
//
//    /**
//     * 当前天气预报城市名
//     */
//    private String mCityName;
//
//    /**
//     * 当前天气预报城市天气代码
//     */
//    private String mCityWeatherCode;
//
////
////    /**
////     * 百度定位服务
////     */
////    private LocationClient mLocationClient;
////
////    /**
////     * 百度定位监听
////     */
////    private BDLocationListener mBDLocationListener;
///**
//     * 首次打开天气界面
//     */
//    private boolean mIsFirstUse = false;
//
//    /**
//     * 是否立刻刷新
//     */
//    private boolean mIsPromptRefresh = true;
//
//    /**
//     * 是否自动定位过
//     */
//    private boolean mIsLocated = false;
//
//    /**
//     * 天气界面布局
//     */
//    private ViewGroup mWeatherGroup;
//
//    /**
//     * 加载中进度框
//     */
//    private ViewGroup mProgressBar;
//
//   // private OnVisibleListener mOnVisibleListener;
//
//    /**
//     * 默认城市名
//     */
//    private String mDefaultCityName;
//
//    /**
//     * 默认城市天气代号
//     */
//    private String mDefaultCityWeatherCode;
//
//    /**
//     * 下拉刷新控件
//     */
//    public SwipeRefreshLayout swipeRefreshLayout;
//
////    @Override
////    public void onCreate(Bundle savedInstanceState) {
////        super.onCreate(savedInstanceState);
////        OttoAppConfig.getInstance().register(this);
////    }
//
////    @SuppressWarnings("deprecation")
////    @Subscribe
////    public void onWallpaperUpdate(WallpaperEvent wallpaperEvent) {
////        if (mBackGround != null) {
////            mBlurDrawable = MyUtil.getWallPaperBlurDrawable(getActivity());
////            mBlurDrawable.setAlpha(mAlpha);
////            mBackGround.setBackgroundDrawable(mBlurDrawable);
////        }
////    }
//
//    @Override
//    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
////        final View view = inflater.inflate(R.layout.fm_wea, container, false);
//        View view = inflater.inflate(R.layout.fm_wea,null);
//        ViewStub viewStub = (ViewStub) view.findViewById(R.id.viewstub_wea);
//        viewStub.inflate();
//        init(view);
//
////        onlyLocation();
////
////        mOnVisibleListener = new OnVisibleListener() {
////            @Override
////            public void onVisible() {
////                ViewStub viewStub = (ViewStub) view.findViewById(R.id.viewstub_wea);
////                viewStub.inflate();
////
////                init(view);
////
////                mCityName = getDefaultCityName();
////                mCityWeatherCode = getDefaultWeatherCode();
////
////                mIsPrepared = true;
////
////                // 不是第一次加载天气界面
////                if (mCityName != null) {
////                    // 初始化天气
////                    try {
////                        initWeather(WeatherUtil.readWeatherInfo(getActivity(), mCityName));
////                    } catch (Exception e) {
////                        LogUtil.e(LOG_TAG, e.toString());
////                    }
////
////                    showWeatherLayout();
////
////                    // 是自动定位
////                    if (mCityWeatherCode.equals(getString(R.string.auto_location))) {
//////                        mIsFirstUse = false;
////                        mIsPromptRefresh = false;
////                        startLocation();
////                    }
////                } else {
////                    showWeatherLayout();
////
////                    // 首次进入天气界面，自动定位天气
//////                    mIsFirstUse = true;
////                    // 不立刻刷新
////                    mIsPromptRefresh = false;
////                    // 自动定位
////                    startLocation();
////                }
////            }
////        };
//        return view;
//    }
//
//
//    @Override
//    public void setData(WeatherInfoBean data) {
//        super.setData(data);
//
//        initWeather(data.getResult().getData());
//
//
//    }
//
//    private void showWeatherLayout() {
//        // 隐藏加载进度框
//        mProgressBar.setVisibility(View.GONE);
//        // 首次进入天气界面显示初始布局
//        mWeatherGroup.setVisibility(View.VISIBLE);
//    }
//
////    /**
////     * 开始定位
////     */
////    private void startLocation() {
////        if (!MyUtil.isNetworkAvailable(getActivity())) {
////            ToastUtil.showShortToast(getActivity(), getString(R.string.internet_error));
////            mIsOnlyLocation = false;
////            return;
////        }
////
////        // 初始化定位管理，监听
////        initLocationManager();
////        mLocationClient.registerLocationListener(mBDLocationListener);    //注册监听函数
////        initLocation();
////        mLocationClient.start();
////        mLocationClient.requestLocation();
////    }
////
////
////    /**
////     * 初始化定位管理监听
////     */
////    private void initLocationManager() {
////        if (mLocationClient == null) {
////            mLocationClient = new LocationClient(getActivity().getApplicationContext());
////        }
////        if (mBDLocationListener == null) {
////            mBDLocationListener = new MyLocationListener();
////        }
////    }
////
////    private void initLocation() {
////        LocationClientOption option = new LocationClientOption();
////        option.setCoorType("bd09ll");//可选，默认gcj02，设置返回的定位结果坐标系
////        option.setIsNeedAddress(true);//可选，设置是否需要地址信息，默认不需要
//////        option.setOpenGps(true);//可选，默认false,设置是否使用gps
////        option.disableCache(true);// 禁止启用缓存定位\
////        mLocationClient.setLocOption(option);
////    }
////
////    class MyLocationListener implements BDLocationListener {
////
////        @Override
////        public void onReceiveLocation(BDLocation location) {
////            try {
////                mLocationClient.stop();
////                mLocationClient.unRegisterLocationListener(mBDLocationListener);
////                if (location == null) {
////                    ToastUtil.showShortToast(getActivity(), getString(R.string.location_fail));
////                    mIsOnlyLocation = false;
////                    return;
////                }
////                LogUtil.d(LOG_TAG, "纬度：" + location.getLatitude() + ",经度：" + location.getLongitude());
////
////                String address = location.getAddrStr();
////                // 定位成功
////                if (161 == location.getLocType() && address != null) {
////                    String cityName = MyUtil.formatCity(address);
////                    if (cityName != null) {
////                        LogUtil.d(LOG_TAG, "城市名：" + cityName);
////                        mCityName = cityName;
////                        mCityWeatherCode = getString(R.string.auto_location);
////
////                        // 初次加载定位保存
////                        if (/*mIsFirstUse || */getDefaultCityName() == null) {
////                            SharedPreferences share = getActivity().getSharedPreferences(
////                                    WeacConstants.EXTRA_WEAC_SHARE, Activity.MODE_PRIVATE);
////                            SharedPreferences.Editor editor = share.edit();
////                            // 保存默认的城市名
////                            editor.putString(WeacConstants.DEFAULT_CITY_NAME, mCityName);
////                            // 保存默认的天气代码
////                            editor.putString(WeacConstants.DEFAULT_WEATHER_CODE, mCityWeatherCode);
////                            editor.apply();
//////                            mIsFirstUse = false;
////                        }
////
////                        if (mIsOnlyLocation) {
////                            mIsOnlyLocation = false;
////                            return;
////                        }
////
////                        // 立刻更新
////                        if (mIsPromptRefresh) {
////                            LogUtil.d(LOG_TAG, "onReceiveLocation：refreshWeather()");
////                            refreshWeather();
////                        } else {
////                            mIsPromptRefresh = true;
////                            mIsLocated = true;
//////                            mIsPrepared = true;
////                            LogUtil.d(LOG_TAG, "onReceiveLocation：lazyLoad()");
////                            pullToRefresh();
////                        }
////                    } else {
////                        mIsOnlyLocation = false;
////                        stopRefresh();
////                        ToastUtil.showShortToast(getActivity(), getString(R.string.can_not_find_current_location));
////                    }
////                    // 定位失败
////                } else {
////                    mIsOnlyLocation = false;
////                    stopRefresh();
////                    ToastUtil.showShortToast(getActivity(), getString(R.string.auto_location_error_retry));
////                }
////            } catch (Exception e) {
////                mIsOnlyLocation = false;
////                LogUtil.e(LOG_TAG, "onReceiveLocation" + e.toString());
////            }
////
////        }
////    }
////
////    private boolean mIsOnlyLocation;
////
////    @Override
////    protected void lazyLoad() {
////        if (!mIsPrepared && mIsVisible) {
////            if (mOnVisibleListener != null) {
////                mOnVisibleListener.onVisible();
////            }
////        }
////        if (mIsPrepared && mIsVisible) {
////            // 自动下拉刷新
////            pullToRefresh();
////        }
////    }
////
////    private void onlyLocation() {
////        // 初次使用天气闹钟，首先需要定位以便能够正确显示天气提示内容
////        if (getDefaultCityName() == null) {
////            mIsOnlyLocation = true;
//////            mIsFirstUse = true;
////            startLocation();
////        }
////    }
////
////    /**
////     * 下拉刷新
////     */
////    private void pullToRefresh() {
////        mHandler = new Handler();
////        mRun = new Runnable() {
////            @Override
////            public void run() {
////                try {
////                    mIsPostDelayed = false;
////                    if (!getActivity().isFinishing()) {
////                        if (!hasActiveUpdated()) {
////                            mPullRefreshScrollView.setRefreshing();
////                        }
////                        // 加载成功
//////                        mHasLoadedOnce = true;
////                    }
////                } catch (Exception e) {
////                    LogUtil.e(LOG_TAG, e.toString());
////                }
////            }
////        };
////        mHandler.postDelayed(mRun, 1000);
////        mIsPostDelayed = true;
////    }
//
//
//    /**
//     * 是否3秒内主动更新过
//     *
//     * @return 主动更新与否
//     */
//    private boolean hasActiveUpdated() {
//        if (mLastActiveUpdateTime == 0) {
//            return false;
//        }
//        long now = SystemClock.elapsedRealtime();
//        long timeD = now - mLastActiveUpdateTime;
//        // 间隔3秒内不再自动更新
//        return timeD <= 3000;
//    }
//
// //   @Override
////    public void onClick(View v) {
////        switch (v.getId()) {
////            // 刷新按钮
////            case R.id.action_refresh:
////                Animation operatingAnim = AnimationUtils.loadAnimation(getActivity(), R.anim.rotate);
////                // 匀速
////                LinearInterpolator lin = new LinearInterpolator();
////                // 设置速率
////                operatingAnim.setInterpolator(lin);
////                mRefreshBtn.startAnimation(operatingAnim);
////                locationOrRefresh();
////                break;
////            // 城市管理按钮
////            case R.id.action_home:
////                // 不响应重复点击
////                if (MyUtil.isFastDoubleClick()) {
////                    return;
////                }
////
////                // 保存默认城市名，判断滑动返回前是否更改了默认城市
////                mDefaultCityName = getDefaultCityName();
////                mDefaultCityWeatherCode = getDefaultWeatherCode();
////
////                // 当不是天气界面并且已经开始延迟刷新天气线程
////                if (mHandler != null && mIsPostDelayed) {
////                    // 取消线程
////                    mHandler.removeCallbacks(mRun);
////                    mIsPostDelayed = false;
////                }
////                // 当正在刷新
////                if (mPullRefreshScrollView.isRefreshing()) {
////                    // 停止刷新
////                    mPullRefreshScrollView.onRefreshComplete();
////                }
////                // 停止刷新动画
////                mRefreshBtn.clearAnimation();
////
////                Intent intent1 = new Intent(getActivity(), CityManageActivity.class);
////                String cityName;
////                // 自动定位
////                if (mCityWeatherCode.equals(getString(R.string.auto_location))) {
////                    cityName = getString(R.string.auto_location);
////                } else {
////                    cityName = mCityName;
////                }
////                intent1.putExtra(WeacConstants.CITY_NAME, cityName);
////                startActivityForResult(intent1, REQUEST_WEA);
////                break;
////            // 雨伞指数
////            case R.id.wea_life_index_rlyt_umbrella:
////                skipToDetailInterface(getString(R.string.umbrella_detail), mLifeIndexUmbrellaDetail);
////                break;
////            // 紫外线指数
////            case R.id.wea_life_index_rlyt_ultraviolet_rays:
////                skipToDetailInterface(getString(R.string.ultraviolet_Rays_detail), mLifeIndexUltravioletRaysDetail);
////                break;
////            // 穿衣指数
////            case R.id.wea_life_index_rlyt_dress:
////                skipToDetailInterface(getString(R.string.dress_detail), mLifeIndexDressDetail);
////                break;
////            // 感冒指数
////            case R.id.wea_life_index_rlyt_cold:
////                skipToDetailInterface(getString(R.string.cold_detail), mLifeIndexColdDetail);
////                break;
////            // 晨练指数
////            case R.id.wea_life_index_rlyt_morning_exercise:
////                skipToDetailInterface(getString(R.string.morning_exercise_detail), mLifeIndexMorningExerciseDetail);
////                break;
////            // 运动指数
////            case R.id.wea_life_index_rlyt_sport:
////                skipToDetailInterface(getString(R.string.sport_detail), mLifeIndexSportDetail);
////                break;
////            // 洗车指数
////            case R.id.wea_life_index_rlyt_carwash:
////                skipToDetailInterface(getString(R.string.car_wash_detail), mLifeIndexCarWashDetail);
////                break;
////            // 晾晒指数
////            case R.id.wea_life_index_rlyt_air_cure:
////                skipToDetailInterface(getString(R.string.air_cure_detail), mLifeIndexAirCureDetail);
////                break;
////        }
////
////    }
////
////    /**
////     * 定位或者直接刷新
////     */
////    private void locationOrRefresh() {
////        // 判断网络是否可用
////        if (!MyUtil.isNetworkAvailable(getActivity())) {
////            stopRefresh();
////            ToastUtil.showShortToast(getActivity(), getString(R.string.internet_error));
////            return;
////        }
////
////        // 不是从自动定位返回
////        if (!mIsLocated && mCityWeatherCode.equals(getString(R.string.auto_location))) {
////            LogUtil.d(LOG_TAG, "  startLocation()");
////            locationPromptRefresh();
////        } else {
////            LogUtil.d(LOG_TAG, "  refreshWeather()");
////            mIsLocated = false;
////            refreshWeather();
////        }
////    }
////
////    /**
////     * 定位并立即刷新
////     */
////    private void locationPromptRefresh() {
//////        mIsFirstUse = false;
////        mIsPromptRefresh = true;
////        startLocation();
////    }
////
//// //   @Override
//////    public void onActivityResult(int requestCode, int resultCode, Intent data) {
//////        super.onActivityResult(requestCode, resultCode, data);
//////        // 取消返回或者滑动返回
//////        if (resultCode != Activity.RESULT_OK) {
//////            if (mDefaultCityName != null && getDefaultCityName() != null) {
//////                // 当改变了默认城市后滑动返回
//////                if (!mDefaultCityName.equals(getDefaultCityName()) ||
//////                        !mDefaultCityWeatherCode.equals(getDefaultWeatherCode())) {
//////                    changeCityWeatherInfo(getDefaultCityName(), getDefaultWeatherCode());
//////                } else {
//////                    String cityName;
//////                    // 自动定位
//////                    if (mCityWeatherCode.equals(getString(R.string.auto_location))) {
//////                        cityName = getString(R.string.auto_location);
//////                    } else {
//////                        cityName = mCityName;
//////                    }
//////
//////                    int number = WeatherDBOperate.getInstance().queryCityManage(cityName);
//////                    // 删除当前城市后滑动返回
//////                    if (number == 0) {
//////                        changeCityWeatherInfo(getDefaultCityName(), getDefaultWeatherCode());
//////                    }
//////                }
//////                // 初次添加城市后滑动返回
//////            } else if (mDefaultCityName == null && getDefaultCityName() != null) {
//////                changeCityWeatherInfo(getDefaultCityName(), getDefaultWeatherCode());
//////            }
//////            return;
//////        }
//////        if (requestCode == REQUEST_WEA) {
//////            String cityName = data.getStringExtra(WeacConstants.CITY_NAME);
//////            String weatherCode = data.getStringExtra(WeacConstants.WEATHER_CODE);
//////            changeCityWeatherInfo(cityName, weatherCode);
//////        }
//////    }
////
//////    /**
//////     * 当更改默认城市或者删除当前城市时更新城市天气信息
//////     */
//////    private void changeCityWeatherInfo(String cityName, String cityWeatherCode) {
//////        if (!TextUtils.isEmpty(cityName)) {
//////            mCityName = cityName;
//////            mCityWeatherCode = cityWeatherCode;
//////
//////            // 滚动到顶端
//////            mPullRefreshScrollView.getRefreshableView().scrollTo(0, 0);
//////            WeatherInfo weatherInfo = WeatherUtil.readWeatherInfo(getActivity(), mCityName);
//////            if (weatherInfo != null) {
//////                initWeather(weatherInfo);
//////            }
//////
//////            long now = System.currentTimeMillis();
//////            SharedPreferences share = getActivity().getSharedPreferences(
//////                    WeacConstants.BASE64, Activity.MODE_PRIVATE);
//////            // 最近一次天气更新时间
//////            long lastTime = share.getLong(getString(R.string.city_weather_update_time,
//////                    mCityName), 0);
//////            long minuteD = (now - lastTime) / 1000 / 60;
//////            // 更新间隔大于10分钟自动下拉刷新
//////            if (minuteD > 10) {
//////                // 自动定位
//////                if (mCityWeatherCode.equals(getString(R.string.auto_location))) {
//////                    locationPromptRefresh();
//////                } else {
//////                    mPullRefreshScrollView.setRefreshing();
//////                }
//////            }
//////        }
//////    }
//////
//////    /**
//////     * 取得默认城市名
//////     *
//////     * @return 默认城市名
//////     */
//////    private String getDefaultCityName() {
//////        SharedPreferences share = getActivity().getSharedPreferences(
//////                WeacConstants.EXTRA_WEAC_SHARE, Activity.MODE_PRIVATE);
//////        return share.getString(WeacConstants.DEFAULT_CITY_NAME, null);
//////    }
////
////    /**
////     * 取得默认天气代号
////     *
////     * @return 默认天气代号
////     */
////    private String getDefaultWeatherCode() {
////        SharedPreferences share = getActivity().getSharedPreferences(
////                WeacConstants.EXTRA_WEAC_SHARE, Activity.MODE_PRIVATE);
////        return share.getString(WeacConstants.DEFAULT_WEATHER_CODE, getString(R.string.auto_location));
////    }
////
//////    /**
//////     * 跳转到详情界面
//////     *
//////     * @param title  标题
//////     * @param detail 详情
//////     */
//////    private void skipToDetailInterface(String title, String detail) {
//////        Intent intent = new Intent(getActivity(), LifeIndexDetailActivity.class);
//////        intent.putExtra(WeacConstants.TITLE, title);
//////        intent.putExtra(WeacConstants.DETAIL, detail);
//////        startActivity(intent);
//////    }
////
////    /**
////     * 刷新天气
////     */
////    private void refreshWeather() {
////        String address;
////        String cityName;
////        // 自动定位
////        if (mCityWeatherCode.equals(getString(R.string.auto_location))) {
////            cityName = mCityName;
////            address = null;
////        } else {
////            cityName = null;
////            address = getString(R.string.address_weather, mCityWeatherCode);
////        }
////        HttpUtil.sendHttpRequest(address, cityName,
////                new HttpCallbackListener() {
////                    @Override
////                    public void onFinish(String response) {
////                        try {
////                            if (!response.contains("error")) {
////                                WeatherInfo weatherInfo = WeatherUtil.handleWeatherResponse(
////                                        new ByteArrayInputStream(response.getBytes()));
////                                // 保存天气信息
////                                WeatherUtil.saveWeatherInfo(weatherInfo, getActivity());
////                                getActivity().runOnUiThread(new SetWeatherInfoRunnable(weatherInfo));
////                                // 无法解析当前位置
////                            } else {
////                                getActivity().runOnUiThread(new Runnable() {
////                                    @Override
////                                    public void run() {
////                                        stopRefresh();
////                                        ToastUtil.showLongToast(getActivity(), getString(R.string.can_not_find_current_location));
////                                    }
////                                });
////                            }
////                        } catch (Exception e) {
//////                            stopRefresh();
////                            LogUtil.e(LOG_TAG, "refreshWeather: " + e.toString());
////                        }
////                    }
////
////                    @Override
////                    public void onError(final Exception e) {
////                        try {
////                            getActivity().runOnUiThread(new Runnable() {
////                                @Override
////                                public void run() {
////                                    stopRefresh();
////                                    ToastUtil.showShortToast(getActivity(),
////                                            getString(R.string.internet_fail));
////                                }
////                            });
////                        } catch (Exception e1) {
//////                            stopRefresh();
////                            LogUtil.e(LOG_TAG, "refreshWeather: " + e1.toString());
////                        }
////                    }
////                }
////        );
////    }
////
////    /**
////     * 停止正在刷新动画
////     */
////    private void stopRefresh() {
////        // 停止正在刷新动画
////        mPullRefreshScrollView.onRefreshComplete();
////        // 取消刷新按钮的动画
////        mRefreshBtn.clearAnimation();
////        // 最近一次更细时间
////        mLastActiveUpdateTime = SystemClock.elapsedRealtime();
////    }
////
////    /**
////     * 设置天气信息
////     */
////    class SetWeatherInfoRunnable implements Runnable {
////
////        private WeatherInfo mWeatherInfo;
////
////        public SetWeatherInfoRunnable(WeatherInfo weatherInfo) {
////            mWeatherInfo = weatherInfo;
////        }
////
////        @Override
////        public void run() {
////            try {
////                stopRefresh();
////                initWeather(mWeatherInfo);
////            } catch (Exception e) {
////                LogUtil.e(LOG_TAG, "SetWeatherInfoRunnable: " + e.toString());
////            }
////        }
////    }
////
//    /**
//     * 初始化天气
//     *
//     * @param weatherInfo 天气信息类
//     */
//    @SuppressWarnings("deprecation")
//    private void initWeather(final WeatherInfoBean.ResultBean.DataBean weatherInfo) {
//        if (weatherInfo == null) {
//            return;
//        }
//        // 多天预报信息
//        List<WeatherInfoBean.ResultBean.DataBean.WeatherBean> weatherDaysForecasts = weatherInfo.getWeather()
//                ;
///*        if (weatherDaysForecasts.size() < 6) {
//            ToastUtil.showShortToast(getActivity(), getString(R.string.no_city_weather_info));
//            return;
//        }*/
//
//        // 昨天天气信息（23：45开始到05：20以前的数据的日期和周）
//        WeatherInfoBean.ResultBean.DataBean.WeatherBean weather;
//        // 昨天天气信息
//        WeatherInfoBean.ResultBean.DataBean.WeatherBean weather1;
//
//
//        // 今天天气信息
//        WeatherInfoBean.ResultBean.DataBean.WeatherBean weather2;
//        // 明天天气信息
//        WeatherInfoBean.ResultBean.DataBean.WeatherBean weather3;
//        // 后天天气信息
//        WeatherInfoBean.ResultBean.DataBean.WeatherBean weather4;
//        // 第五天天天气信息
//        WeatherInfoBean.ResultBean.DataBean.WeatherBean weather5;
//        // 第六天天气信息
//        WeatherInfoBean.ResultBean.DataBean.WeatherBean weather6;
//
//        String time[] = weatherInfo.getRealtime().getTime().split(":");
//        int hour1 = Integer.parseInt(time[0]);
//        int minute1 = Integer.parseInt(time[1]);
//        //更新时间从23：45开始到05：20以前的数据，后移一天填充
//        if ((hour1 == 23 && minute1 >= 45) || (hour1 < 5) ||
//                ((hour1 == 5) && (minute1 < 20))) {
//            if (weatherDaysForecasts.size() >= 6) {
//                weather = weatherDaysForecasts.get(0);
//                weather1 = weatherDaysForecasts.get(1);
//                weather2 = weatherDaysForecasts.get(2);
//                weather3 = weatherDaysForecasts.get(3);
//                weather4 = weatherDaysForecasts.get(4);
//                weather5 = weatherDaysForecasts.get(5);
//                weather6 = weatherDaysForecasts.get(5);
//            } else {
//                weather = null;
//                weather2 = weatherDaysForecasts.get(0);
//                weather3 = weatherDaysForecasts.get(1);
//                weather4 = weatherDaysForecasts.get(2);
//                weather5 = weatherDaysForecasts.get(3);
//                weather6 = weatherDaysForecasts.get(4);
//
//
//            }
//        } else {
//            if (weatherDaysForecasts.size() >= 6) {
//                weather = weatherDaysForecasts.get(0);
//                weather1 = weatherDaysForecasts.get(0);
//                weather2 = weatherDaysForecasts.get(1);
//                weather3 = weatherDaysForecasts.get(2);
//                weather4 = weatherDaysForecasts.get(3);
//                weather5 = weatherDaysForecasts.get(4);
//                weather6 = weatherDaysForecasts.get(5);
//            } else {
//                weather = null;
//                weather1 = null;
//                weather2 = weatherDaysForecasts.get(0);
//                weather3 = weatherDaysForecasts.get(1);
//                weather4 = weatherDaysForecasts.get(2);
//                weather5 = weatherDaysForecasts.get(3);
//                weather6 = weatherDaysForecasts.get(4);
//            }
//        }
//
//        Calendar calendar = Calendar.getInstance();
//        // 现在小时
//        int hour = calendar.get(Calendar.HOUR_OF_DAY);
//
//        // 设置城市名
////        setCityName(weatherInfo);
//        // 设置预警信息
//        setAlarmInfo(weatherInfo.getPm25());
//        // 设置更新时间
//        setUpdateTime(weatherInfo.getRealtime());
//        // 设置温度
//        setTemperature(weatherInfo.getRealtime());
//        // 设置天气类型
//        setWeatherType(weatherInfo.getRealtime(), hour);
//        // 设置aqi
//        setAQI(weatherInfo.getPm25().getPm25());
//        // 设置湿度
//        setHumidity(weatherInfo.getRealtime().getWeather());
//        // 设置风向、风力
//        setWind(weatherInfo.getRealtime().getWind());
//        // 设置今天，明天，后天大概天气
//        setThreeDaysWeather(weather2, weather3, weather4, hour);
//
//        // 设置多天天气预报
//        setDaysForecast(weather2, weather3, weather4, weather5, weather6,
//                hour1, minute1, calendar);
//
//        // 生活指数信息
//        setLifeIndex(weatherInfo.getLife());
//
//        // 处理城市管理表
//     //   processCityManageTable(weatherInfo, weather2);
//
//    }
////
////    /**
////     * 处理城市管理表
////     */
////    private void processCityManageTable(WeatherInfo weatherInfo, WeatherDaysForecast weather2) {
////        String cityName;
////        // 自动定位
////        if (getString(R.string.auto_location).equals(mCityWeatherCode)) {
////            cityName = mCityWeatherCode;
////        } else {
////            cityName = weatherInfo.getCity();
////        }
////
////        CityManage cityManage = new CityManage();
////        cityManage.setTempHigh(weather2.getHigh().substring(3));
////        cityManage.setTempLow(weather2.getLow().substring(3));
////        cityManage.setWeatherType(MyUtil.getWeatherType
////                (getActivity(), weather2.getTypeDay(), weather2.getTypeNight()));
////        cityManage.setWeatherTypeDay(weather2.getTypeDay());
////        cityManage.setWeatherTypeNight(weather2.getTypeNight());
////
////        // CityManage表中存在此城市时
////        if (1 == WeatherDBOperate.getInstance().queryCityManage(cityName)) {
////            // 修改城市管理item信息
////            WeatherDBOperate.getInstance().updateCityManage(cityManage, cityName);
////        }
////
////        int number = WeatherDBOperate.getInstance().queryCityManage(mCityWeatherCode);
////        if (mCityWeatherCode.equals(getString(R.string.auto_location))) {
////            // 城市管理表不存在定位
////            if (number == 0) {
////                setCityManage(cityManage);
////
////                // 存储城市管理表
////                boolean result = WeatherDBOperate.getInstance().saveCityManage(cityManage);
////                // 城市管理表城市个数
////                int total = WeatherDBOperate.getInstance().queryCityManage();
////                // 存储成功
////                if (result && total <= 1) {
////                    SharedPreferences share = getActivity().getSharedPreferences(
////                            WeacConstants.EXTRA_WEAC_SHARE, Activity.MODE_PRIVATE);
////                    SharedPreferences.Editor editor = share.edit();
////                    // 保存城市管理的默认城市
////                    editor.putString(WeacConstants.DEFAULT_CITY, mCityWeatherCode);
////                    editor.apply();
////                } // 城市管理表存在定位
////            } else {
////                int number1 = WeatherDBOperate.getInstance().queryCityManageLocationCity(mCityName);
////                // 定位城市发生变更
////                if (number1 == 0) {
////                    setCityManage(cityManage);
////
////                    // 更新城市管理表
////                    WeatherDBOperate.getInstance().updateCityManage(cityManage, mCityWeatherCode);
////
////                    // 默认城市是自动定位
////                    if (getDefaultWeatherCode().equals(mCityWeatherCode)) {
////                        SharedPreferences share = getActivity().getSharedPreferences(
////                                WeacConstants.EXTRA_WEAC_SHARE, Activity.MODE_PRIVATE);
////                        SharedPreferences.Editor editor = share.edit();
////                        editor.putString(WeacConstants.DEFAULT_CITY_NAME, mCityName);
////                        editor.apply();
////                    }
////                }
////            }
////        }
////    }
////
////    private void setCityManage(CityManage cityManage) {
////        cityManage.setCityName(mCityWeatherCode);
////        cityManage.setWeatherCode(mCityWeatherCode);
////        cityManage.setLocationCity(mCityName);
////    }
////
//    /**
//     * 设置多天天气预报
//     */
//    private void setDaysForecast(WeatherInfoBean.ResultBean.DataBean.WeatherBean weather2,
//                                 WeatherInfoBean.ResultBean.DataBean.WeatherBean weather3,
//                                 WeatherInfoBean.ResultBean.DataBean.WeatherBean weather4,
//                                 WeatherInfoBean.ResultBean.DataBean.WeatherBean weather5,
//                                 WeatherInfoBean.ResultBean.DataBean.WeatherBean weather6,
//                                 int hour1,
//                                 int minute1,
//                                 Calendar calendar) {
//        // 日期和星期标题 【索引0：日期;索引1：星期】
//
//        String[] day2;
//        String[] day3;
//        String[] day4;
//        String[] day5;
//        String[] day6;
//        if ((hour1 == 23 && minute1 >= 45) || (hour1 < 5) || ((hour1 == 5) && (minute1 < 20))) {
//            if (weather2 != null) {
//                day2 = getDay(weather2);
//            } else {
//                day2 = null;
//            }
//
//            assert weather2 != null;
//
//            day3 = getDay(weather3);
//            day4 = getDay(weather4);
//            day5 = getDay(weather5);
//            day6 = getDay(weather6);
//        } else {
//            if (weather2 != null) {
//                day2 = getDay(weather2);
//            } else {
//                day2 = null;
//            }
//
//            assert weather2 != null;
//            day3 = getDay(weather3);
//            day4 = getDay(weather4);
//            day5 = getDay(weather5);
//            day6 = getDay(weather6);
//        }
//
//        // 设置标题星期
//        mDaysForecastTvWeek2.setText(getString(R.string.today));
//        mDaysForecastTvWeek3.setText(day3[1]);
//        mDaysForecastTvWeek4.setText(day4[1]);
//        mDaysForecastTvWeek5.setText(day5[1]);
//        mDaysForecastTvWeek6.setText(day6[1]);
//
//
//
////        // 斜杠
////        String date = getString(R.string.date);
////        // 设置日期
////        if (day01 != null) {
////            mDaysForecastTvDay1.setText(String.format(date, month1, day01));
////        } else {
////            mDaysForecastTvDay1.setText(R.string.dash);
////        }
//        // 设置日期
//
//        mDaysForecastTvDay2.setText(day2[0]);
//        mDaysForecastTvDay3.setText(day3[0]);
//        mDaysForecastTvDay4.setText(day4[0]);
//        mDaysForecastTvDay5.setText(day5[0]);
//        mDaysForecastTvDay6.setText(day6[0]);
//
//        // 取得白天天气类型图片id
////        int weatherDayId1;
////        if (weather != null) {
////            assert weather1 != null;
////            weatherDayId1 = MyUtil.getWeatherTypeImageID(weather1.getTypeDay(), true);
////        } else {
////            weatherDayId1 = R.drawable.ic_weather_no;
////        }
//        int weatherDayId2 = MyUtil.getWeatherTypeImageID(weather2.getInfo().getDay().get(1), true);
//        int weatherDayId3 = MyUtil.getWeatherTypeImageID(weather3.getInfo().getDay().get(1), true);
//        int weatherDayId4 = MyUtil.getWeatherTypeImageID(weather4.getInfo().getDay().get(1), true);
//        int weatherDayId5 = MyUtil.getWeatherTypeImageID(weather5.getInfo().getDay().get(1), true);
//        int weatherDayId6 = MyUtil.getWeatherTypeImageID(weather6.getInfo().getDay().get(1), true);
//
//        //设置白天天气类型图片
////        mDaysForecastWeaTypeDayIv1.setImageResource(weatherDayId1);
//        mDaysForecastWeaTypeDayIv2.setImageResource(weatherDayId2);
//        mDaysForecastWeaTypeDayIv3.setImageResource(weatherDayId3);
//        mDaysForecastWeaTypeDayIv4.setImageResource(weatherDayId4);
//        mDaysForecastWeaTypeDayIv5.setImageResource(weatherDayId5);
//        mDaysForecastWeaTypeDayIv6.setImageResource(weatherDayId6);
//
//        // 设置白天天气类型文字
//        if (weather2 != null) {
//            mDaysForecastWeaTypeDayTv2.setText(weather2.getInfo().getDay().get(1));
//        } else {
//            mDaysForecastWeaTypeDayTv2.setText(R.string.dash);
//        }
//
//        mDaysForecastWeaTypeDayTv3.setText(weather3.getInfo().getDay().get(1));
//        mDaysForecastWeaTypeDayTv4.setText(weather4.getInfo().getDay().get(1));
//        mDaysForecastWeaTypeDayTv5.setText(weather5.getInfo().getDay().get(1));
//        mDaysForecastWeaTypeDayTv6.setText(weather6.getInfo().getDay().get(1));
//
//        // 设置白天温度曲线
//        if (weather2 != null) {
//            mCharView.setTempDay(new int[]{
//                    getTemp(weather2.getInfo().getDay().get(2)),
//                    getTemp(weather3.getInfo().getDay().get(2)),
//                    getTemp(weather4.getInfo().getDay().get(2)),
//                    getTemp(weather5.getInfo().getDay().get(2)),
//                    getTemp(weather6.getInfo().getDay().get(2))});
//        }
//        // 设置夜间温度曲线
//        if (weather2 != null) {
//            mCharView.setTempNight(new int[]{
//                    getTemp(weather2.getInfo().getNight().get(2)),
//                    getTemp(weather3.getInfo().getNight().get(2)),
//                    getTemp(weather4.getInfo().getNight().get(2)),
//                    getTemp(weather5.getInfo().getNight().get(2)),
//                    getTemp(weather6.getInfo().getNight().get(2))});
//        }
//
//        mCharView.invalidate();
//
//        // 设置夜间天气类型文字
//        if (weather2 != null) {
//            mDaysForecastWeaTypeNightTv2.setText(weather2.getInfo().getNight().get(1));
//        } else {
//            mDaysForecastWeaTypeNightTv2.setText(R.string.dash);
//        }
//        mDaysForecastWeaTypeNightTv3.setText(weather3.getInfo().getNight().get(1));
//        mDaysForecastWeaTypeNightTv4.setText(weather4.getInfo().getNight().get(1));
//        mDaysForecastWeaTypeNightTv5.setText(weather5.getInfo().getNight().get(1));
//        mDaysForecastWeaTypeNightTv6.setText(weather6.getInfo().getNight().get(1));
//
//
//
//        // 取得夜间天气类型图片id
//        int weatherNightId2;
//        if (weather2 != null) {
//            weatherNightId2 = MyUtil.getWeatherTypeImageID(weather2.getInfo().getNight().get(1), false);
//        } else {
//            weatherNightId2 = R.drawable.ic_weather_no;
//        }
//        int weatherNightId3 = MyUtil.getWeatherTypeImageID(weather3.getInfo().getNight().get(1), false);
//        int weatherNightId4 = MyUtil.getWeatherTypeImageID(weather4.getInfo().getNight().get(1), false);
//        int weatherNightId5 = MyUtil.getWeatherTypeImageID(weather5.getInfo().getNight().get(1), false);
//        int weatherNightId6 = MyUtil.getWeatherTypeImageID(weather6.getInfo().getNight().get(1), false);
//
//        //设置夜间天气类型图片
//        mDaysForecastWeaTypeNightIv2.setImageResource(weatherNightId2);
//        mDaysForecastWeaTypeNightIv3.setImageResource(weatherNightId3);
//        mDaysForecastWeaTypeNightIv4.setImageResource(weatherNightId4);
//        mDaysForecastWeaTypeNightIv5.setImageResource(weatherNightId5);
//        mDaysForecastWeaTypeNightIv6.setImageResource(weatherNightId6);
//
//        // 设置风向
//        if (weather2 != null) {
//            mDaysForecastWindDirectionTv2.setText(weather2.getInfo().getNight().get(3));
//        } else {
//            mDaysForecastWindDirectionTv2.setText(R.string.dash);
//        }
//
//        mDaysForecastWindDirectionTv3.setText(weather3.getInfo().getNight().get(3));
//        mDaysForecastWindDirectionTv4.setText(weather4.getInfo().getNight().get(3));
//        mDaysForecastWindDirectionTv5.setText(weather5.getInfo().getNight().get(3));
//        mDaysForecastWindDirectionTv6.setText(weather6.getInfo().getNight().get(3));
//
//        // 设置风力
//        if (weather2 != null) {
//            mDaysForecastWindPowerTv2.setText(weather2.getInfo().getNight().get(4));
//        } else {
//            mDaysForecastWindPowerTv2.setText(R.string.dash);
//        }
//        mDaysForecastWindPowerTv2.setText(weather2.getInfo().getNight().get(4));
//        mDaysForecastWindPowerTv3.setText(weather3.getInfo().getNight().get(4));
//        mDaysForecastWindPowerTv4.setText(weather4.getInfo().getNight().get(4));
//        mDaysForecastWindPowerTv5.setText(weather5.getInfo().getNight().get(4));
//        mDaysForecastWindPowerTv6.setText(weather6.getInfo().getNight().get(4));
//    }
//
////    /**
////     * 生活指数信息
////     */
////    private void setLifeIndex(WeatherInfo weatherInfo) {
////        List<WeatherLifeIndex> weatherLifeIndexes = weatherInfo.getWeatherLifeIndex();
////        // 设置生活指数
////        for (WeatherLifeIndex index : weatherLifeIndexes) {
////            setLifeIndex(index);
////        }
////    }
////
//    /**
//     * 设置今天，明天，后天大概天气
//     *  @param weather2 今天
//     * @param weather3 明天
//     * @param weather4 后天
//     * @param hour     当前小时
//     */
//    private void setThreeDaysWeather(WeatherInfoBean.ResultBean.DataBean.WeatherBean weather2, WeatherInfoBean.ResultBean.DataBean.WeatherBean weather3,
//                                     WeatherInfoBean.ResultBean.DataBean.WeatherBean weather4, int hour) {
//        // 天气类型图片id
//        int weatherId;
//
//        // 设置今天天气信息
//        // 当前为凌晨
//        if (hour >= 0 && hour < 6) {
//            weatherId = MyUtil.getWeatherTypeImageID(weather2.getInfo().getDay().get(1), false);
//            // 当前为白天时
//        } else if (hour >= 6 && hour < 18) {
//            weatherId = MyUtil.getWeatherTypeImageID(weather2.getInfo().getNight().get(1), true);
//            // 当前为夜间
//        } else {
//            weatherId = MyUtil.getWeatherTypeImageID(weather2.getInfo().getNight().get(1), false);
//        }
//        mWeatherTypeIvToday.setImageResource(weatherId);
//        mTempHighTvToday.setText(String.format(getString(R.string.temp_value)
//                ,weather2.getInfo().getDay().get(2)));
//        mTempLowTvToday.setText(String.format(getString(R.string.temp_value)
//                ,weather2.getInfo().getNight().get(2)));
//        mWeatherTypeTvToday.setText(MyUtil.getWeatherType
//                (getActivity(), weather2.getInfo().getDay().get(1), weather2.getInfo().getNight().get(1)));
//
//        // 设置明天天气信息
//        weatherId = MyUtil.getWeatherTypeImageID(weather3.getInfo().getNight().get(1), true);
//        mWeatherTypeIvTomorrow.setImageResource(weatherId);
//;
//        mTempHighTvTomorrow.setText(String.format(getString(R.string.temp_value)
//                ,weather3.getInfo().getDay().get(2)));
//        mTempLowTvTomorrow.setText(String.format(getString(R.string.temp_value)
//                ,weather3.getInfo().getNight().get(2)));
//        mWeatherTypeTvTomorrow.setText(MyUtil.getWeatherType
//                (getActivity(), weather3.getInfo().getDay().get(1), weather3.getInfo().getNight().get(1)));
//
//        // 设置后天天气信息
//        weatherId = MyUtil.getWeatherTypeImageID(weather4.getInfo().getDay().get(1), true);
//        mWeatherTypeIvDayAfterTomorrow.setImageResource(weatherId);
//
//
//        mTempHighTvDayAfterTomorrow.setText(String.format(getString(R.string.temp_value)
//                ,weather4.getInfo().getDay().get(2)));
//        mTempLowTvDayAfterTomorrow.setText(String.format(getString(R.string.temp_value)
//                ,weather4.getInfo().getNight().get(2)));
//        mWeatherTypeTvDayAfterTomorrow.setText(MyUtil.getWeatherType
//                (getActivity(), weather4.getInfo().getDay().get(1), weather4.getInfo().getNight().get(1)));
//    }
//
//    /**
//     * 设置风向、风力
//     */
//    private void setWind(WeatherInfoBean.ResultBean.DataBean.RealtimeBean.WindBean windBean) {
//        if (windBean.getDirect() != null && windBean.getPower() != null) {
//            // 设置风向图片
//            setImage(mWindTv, getWindImageId(windBean.getDirect()));
//            // 设置风向、风力
//            mWindTv.setText(String.format(getString(R.string.aqi)
//                    , windBean.getDirect(), windBean.getPower()));
//        } else {
//            setImage(mWindTv, R.drawable.weather_ic_wind_3);
//            mWindTv.setText(R.string.no);
//        }
//    }
//
//    /**
//     * 设置湿度
//     */
//    private void setHumidity(WeatherInfoBean.ResultBean.DataBean.RealtimeBean.WeatherBean weatherBean) {
//        if (weatherBean.getHumidity() != null) {
//            // 设置湿度图片
////            setImage(mHumidityTv, getHumidityImageId(weatherInfo.getHumidity()));
//            // 设置湿度
//            mHumidityTv.setText(String.format(getString(R.string.humidity),
//                    weatherBean.getHumidity()));
//        } else {
////            setImage(mHumidityTv, R.drawable.ic_humidity20);
//            mHumidityTv.setText(R.string.no);
//        }
//    }
//
//    /**
//     * 设置aqi
//     */
//    private void setAQI(WeatherInfoBean.ResultBean.DataBean.Pm25Bean.PmBean pmBean) {
//        if (pmBean.getQuality() != null && pmBean.getCurPm() != null) {
//            mAqiTv.setVisibility(View.VISIBLE);
//            // 设置空气质量图片
//            setImage(mAqiTv, getQualityImageId(pmBean.getQuality()));
//            // 设置空气质量
//            mAqiTv.setText(String.format(getString(R.string.aqi),
//                    pmBean.getQuality(), pmBean.getCurPm()));
//        } else {
//            mAqiTv.setVisibility(View.GONE);
//        }
//    }
////
//    /**
//     * 设置天气类型
//     *  @param weatherToday 今天天气信息
//     * @param hour         当前小时*/
//    private void setWeatherType(WeatherInfoBean.ResultBean.DataBean.RealtimeBean weatherToday, int hour) {
//        if (hour < 18) {
//            // 白天天气
//            mWeatherTypeTv.setText(weatherToday.getWeather().getInfo());
//        } else {
//            // 夜间天气
//            mWeatherTypeTv.setText(weatherToday.getWeather().getInfo());
//        }
//    }
////
//    /**
//     * 设置温度
//     *
//     * @param weatherInfo weatherInfo
//     */
//    private void setTemperature(WeatherInfoBean.ResultBean.DataBean.RealtimeBean weatherInfo) {
//        String temp = weatherInfo.getWeather().getTemperature();
//        mTemperature1Iv.setVisibility(View.VISIBLE);
//        mTemperature2Iv.setVisibility(View.VISIBLE);
//        mTemperature3Iv.setVisibility(View.VISIBLE);
//        if (temp != null) {
//            // 两位正数
//            if (temp.length() == 2 && !temp.contains("-")) {
//                int temp1 = Integer.parseInt(temp.substring(0, 1));
//                setTemperatureImage(temp1, mTemperature1Iv);
//                int temp2 = Integer.parseInt(temp.substring(1));
//                setTemperatureImage(temp2, mTemperature2Iv);
//                mTemperature3Iv.setVisibility(View.GONE);
//                // 一位
//            } else if (temp.length() == 1 && !temp.contains("-")) {
//                int temp1 = Integer.parseInt(temp);
//                setTemperatureImage(temp1, mTemperature1Iv);
//                mTemperature2Iv.setVisibility(View.GONE);
//                mTemperature3Iv.setVisibility(View.GONE);
//                // 两位负数
//            } else if (temp.length() == 2 && temp.contains("-")) {
//                mTemperature1Iv.setImageResource(R.drawable.weather_ic_minus);
//                int temp2 = Integer.parseInt(temp.substring(1));
//                setTemperatureImage(temp2, mTemperature2Iv);
//                mTemperature3Iv.setVisibility(View.GONE);
//                // 三位负数
//            } else if (temp.length() == 3 && temp.contains("-")) {
//                mTemperature1Iv.setImageResource(R.drawable.weather_ic_minus);
//                int temp2 = Integer.parseInt(temp.substring(1, 2));
//                setTemperatureImage(temp2, mTemperature2Iv);
//                int temp3 = Integer.parseInt(temp.substring(2));
//                setTemperatureImage(temp3, mTemperature3Iv);
//            } else {
//                mTemperature1Iv.setImageResource(R.drawable.weather_number_0);
//                mTemperature2Iv.setImageResource(R.drawable.weather_number_0);
//                mTemperature3Iv.setImageResource(R.drawable.weather_number_0);
//            }
//        } else {
//            mTemperature1Iv.setImageResource(R.drawable.weather_number_0);
//            mTemperature2Iv.setImageResource(R.drawable.weather_number_0);
//            mTemperature3Iv.setImageResource(R.drawable.weather_number_0);
//        }
//    }
////
//    /**
//     * 设置更新时间
//     *
//     * @param realtimeBean weatherInfo
//     */
//    @SuppressWarnings("deprecation")
//    private void setUpdateTime(WeatherInfoBean.ResultBean.DataBean.RealtimeBean realtimeBean) {
//        if (realtimeBean.getTime() != null) {
//            long now = System.currentTimeMillis();
//            SharedPreferences share = getActivity().getSharedPreferences(
//                    WeacConstants.BASE64, Activity.MODE_PRIVATE);
//            // 最近一次天气更新时间
//            long lastTime = share.getLong(getString(R.string.city_weather_update_time,
//                    realtimeBean.getCity_name()), 0);
//            // 更新间隔时间（小时）
//            long minuteD = (now - lastTime) / 1000 / 60 / 60;
//            // 更新时间
//            String updateTime;
//            if (minuteD < 24) {
//                updateTime = String.format(getString(R.string.update_time), realtimeBean.getTime());
//            } else if (minuteD >= 24 && minuteD < 48) {
//                updateTime = String.format(getString(R.string.update_time2), realtimeBean.getTime());
//            } else if (minuteD >= 48 && minuteD < 72) {
//                updateTime = String.format(getString(R.string.update_time3), realtimeBean.getTime());
//            } else if (minuteD >= 72 && minuteD < 96) {
//                updateTime = String.format(getString(R.string.update_time4), 3);
//            } else if (minuteD >= 96 && minuteD < 120) {
//                updateTime = String.format(getString(R.string.update_time4), 4);
//            } else if (minuteD >= 120 && minuteD < 144) {
//                updateTime = String.format(getString(R.string.update_time4), 5);
//            } else if (minuteD >= 144 && minuteD < 168) {
//                updateTime = String.format(getString(R.string.update_time4), 6);
//            } else {
//                updateTime = getString(R.string.data_void);
//            }
//            mUpdateTimeTv.setText(realtimeBean.getTime());
//            // 当不是数据过期
//            if (!updateTime.equals(getString(R.string.data_void))) {
//                mUpdateTimeTv.setTextColor(getResources().getColor(R.color.alpha_60_white));
//            } else {
//                mUpdateTimeTv.setTextColor(getResources().getColor(R.color.red));
//            }
//        } else {
//            mUpdateTimeTv.setText(getString(R.string.dash));
//            mUpdateTimeTv.setTextColor(getResources().getColor(R.color.alpha_60_white));
//        }
//    }
//
//    /**
//     *  设置P2.5信息
//     * @param pm25Bean weatherInfo
//     */
//    private void setAlarmInfo(final WeatherInfoBean.ResultBean.DataBean.Pm25Bean pm25Bean) {
//        if (pm25Bean.getPm25() != null) {
//            mAlarmTv.setVisibility(View.VISIBLE);
//            mAlarmTv.setText(pm25Bean.getPm25().getQuality());
////            mAlarmTv.setOnClickListener(new View.OnClickListener() {
////                @Override
////                public void onClick(View v) {
////                    // 警报详情
////                    String detail = weatherInfo.getAlarmDetail();
////                    // 替换换行"\r\n"  \\\：转义字符
////                    detail = detail.replaceAll("\\\\r\\\\n", "");
////                    String format;
////                    try {
////                        Date date = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss", Locale.getDefault())
////                                .parse(weatherInfo.getAlarmTime());
////                        format = new SimpleDateFormat("MM月dd日 HH:mm", Locale.getDefault()).format(date);
////                    } catch (ParseException e) {
////                        LogUtil.e(LOG_TAG, "initWeather: " + e.toString());
////                        format = weatherInfo.getAlarmTime();
////                    }
////                    String time = getString(R.string.release_time, format);
////
////                    Intent intent = new Intent(getActivity(), WeatherAlarmActivity.class);
////                    intent.putExtra(WeacConstants.TITLE, getString(R.string.alarm_title,
////                            weatherInfo.getAlarmType(), weatherInfo.getAlarmDegree()));
////                    intent.putExtra(WeacConstants.DETAIL, detail);
////                    intent.putExtra(WeacConstants.TIME, time);
////                    startActivity(intent);
////                }
////            });
//        } else {
//            mAlarmTv.setVisibility(View.GONE);
//        }
//    }
////
////    /**
////     * 设置城市名
////     *
////     * @param weatherInfo weatherInfo
////     */
////    @SuppressWarnings("deprecation")
////    private void setCityName(WeatherInfo weatherInfo) {
////        if (weatherInfo.getCity() != null) {
////            mCityNameTv.setText(weatherInfo.getCity());
////            // 不是自动定位
////            if (!getString(R.string.auto_location).equals(mCityWeatherCode)) {
////                mCityNameTv.setCompoundDrawables(null, null, null, null);
////            } else {
////                Drawable drawable = getResources().getDrawable(R.drawable.ic_gps);
////                if (drawable != null) {
////                    drawable.setBounds(0, 0, drawable.getMinimumWidth(),
////                            drawable.getMinimumHeight());
////                    // 设置图标
////                    mCityNameTv.setCompoundDrawables(drawable, null, null, null);
////                }
////            }
////        } else {
////            mCityNameTv.setText(getString(R.string.dash));
////            mCityNameTv.setCompoundDrawables(null, null, null, null);
////        }
////    }
////
//    /**
//     * 取得风向图片id
//     *
//     * @param windDirection 风向
//     * @return 风向图片id
//     */
//    private int getWindImageId(String windDirection) {
//        int imgId;
//        switch (windDirection) {
//            case "南风":
//                imgId = R.drawable.weather_ic_wind_1;
//                break;
//            case "西南风":
//                imgId = R.drawable.weather_ic_wind_2;
//                break;
//            case "西风":
//                imgId = R.drawable.weather_ic_wind_3;
//                break;
//            case "西北风":
//                imgId = R.drawable.weather_ic_wind_4;
//                break;
//            case "北风":
//                imgId = R.drawable.weather_ic_wind_5;
//                break;
//            case "东北风":
//                imgId = R.drawable.weather_ic_wind_6;
//                break;
//            case "东风":
//                imgId = R.drawable.weather_ic_wind_7;
//                break;
//            case "东南风":
//                imgId = R.drawable.weather_ic_wind_8;
//                break;
//            default:
//                imgId = R.drawable.weather_ic_wind_3;
//                break;
//        }
//        return imgId;
//    }
//
///*    *//**
//     * 取得湿度图片id
//     *
//     * @param humidity 湿度
//     * @return 湿度图片id
//     *//*
//    private int getHumidityImageId(String humidity) {
//        int imgId;
//        int num = Integer.parseInt(humidity.split("%")[0]);
//        if (num == 0)
//            imgId = R.drawable.ic_humidity0;
//        else if (num <= 10)
//            imgId = R.drawable.ic_humidity10;
//        else if (num <= 20)
//            imgId = R.drawable.ic_humidity20;
//        else if (num <= 30)
//            imgId = R.drawable.ic_humidity30;
//        else if (num <= 40)
//            imgId = R.drawable.ic_humidity40;
//        else if (num <= 50)
//            imgId = R.drawable.ic_humidity50;
//        else if (num <= 60)
//            imgId = R.drawable.ic_humidity60;
//        else if (num <= 70)
//            imgId = R.drawable.ic_humidity70;
//        else if (num <= 80)
//            imgId = R.drawable.ic_humidity80;
//        else if (num < 100)
//            imgId = R.drawable.ic_humidity90;
//        else if (num == 100)
//            imgId = R.drawable.ic_humidity100;
//        else imgId = R.drawable.ic_humidity20;
//        return imgId;
//    }*/
////
//    /**
//     * 设置左侧图片
//     *
//     * @param tv      textView
//     * @param imageId 图片id
//     */
//    private void setImage(TextView tv, int imageId) {
//        @SuppressWarnings("deprecation") Drawable drawable = getResources().getDrawable(imageId);
//        if (drawable != null) {
//            drawable.setBounds(0, 0, drawable.getMinimumWidth(),
//                    drawable.getMinimumHeight());
//            // 设置图片
//            tv.setCompoundDrawables(drawable, null, null, null);
//        }
//    }
////
//    /**
//     * 取得aqi图片id
//     *
//     * @param quality 大气质量
//     * @return aqi图片id
//     */
//    private int getQualityImageId(String quality) {
//        int imgId;
//        switch (quality) {
//            case "优":
//                imgId = R.drawable.weather_ic_quality_nice;
//                break;
//            case "良":
//                imgId = R.drawable.weather_ic_quality_good;
//                break;
//            case "轻度污染":
//                imgId = R.drawable.weather_ic_quality_little;
//                break;
//            case "中度污染":
//                imgId = R.drawable.weather_ic_quality_medium;
//                break;
//            case "重度污染":
//                imgId = R.drawable.weather_ic_quality_serious;
//                break;
//            case "严重污染":
//                imgId = R.drawable.weather_ic_quality_terrible;
//                break;
//            default:
//                imgId = R.drawable.weather_ic_quality_nice;
//                break;
//        }
//        return imgId;
//    }
//
//    /**
//     * 设置生活指数
//     *
//     * @param
//     */
//
////    "life": {     /*生活指数*/
////        "date": "2014-10-15",
////                "info": {
////            "chuanyi": [     /*穿衣指数*/
////            "较舒适",
////                    "建议着薄外套或牛仔衫裤等服装。年老体弱者宜着夹克衫、薄毛衣等。昼夜温差较大，注意适当增减衣服。"
////            ],
////            "ganmao": [    /*感冒指数*/
////            "较易发",
////                    "昼夜温差较大，较易发生感冒，请适当增减衣服。体质较弱的朋友请注意防护。"
////            ],
////            "kongtiao": [   /*空调指数*/
////            "较少开启",
////                    "您将感到很舒适，一般不需要开启空调。"
////            ],
////            "wuran": [     /*污染指数*/
////            "良",
////                    "气象条件有利于空气污染物稀释、扩散和清除，可在室外正常活动。"
////            ],
////            "xiche": [     /*洗车指数*/
////            "较适宜",
////                    "较适宜洗车，未来一天无雨，风力较小，擦洗一新的汽车至少能保持一天。"
////            ],
////            "yundong": [     /*运动指数*/
////            "较适宜",
////                    "天气较好，但风力较大，推荐您进行室内运动，若在户外运动请注意防风。"
////            ],
////            "ziwaixian": [   /*紫外线*/
////            "中等",
////                    "属中等强度紫外线辐射天气，外出时建议涂擦SPF高于15、PA+的防晒护肤品，戴帽子、太阳镜。"
////            ]
//    private void setLifeIndex(WeatherInfoBean.ResultBean.DataBean.LifeBean lifeBean) {
//
////        switch (index.getIndexName()) {
//            //"雨伞指数":
////                mLifeIndexUmbrellaTv.setText(lifeBean.getInfo().get().get(0));
////                mLifeIndexUmbrellaDetail = index.getIndexDetail();
//          //"紫外线强度":
//                mLifeIndexUltravioletRaysTv.setText(lifeBean.getInfo().getZiwaixian().get(0));
//                mLifeIndexUltravioletRaysDetail = lifeBean.getInfo().getZiwaixian().get(1);
//           //"穿衣指数":
//                mLifeIndexDressTv.setText( lifeBean.getInfo().getChuanyi().get(0));
//                mLifeIndexDressDetail = lifeBean.getInfo().getChuanyi().get(1);
//           // "感冒指数":
//                mLifeIndexColdTv.setText(lifeBean.getInfo().getGanmao().get(0));
//                mLifeIndexColdDetail = lifeBean.getInfo().getGanmao().get(1);
//           //"晨练指数":
//                mLifeIndexMorningExerciseTv.setText(lifeBean.getInfo().getKongtiao().get(0));
//                mLifeIndexMorningExerciseDetail = lifeBean.getInfo().getKongtiao().get(1);
//            // "运动指数":
//                mLifeIndexSportTv.setText(lifeBean.getInfo().getYundong().get(0));
//                mLifeIndexSportDetail = lifeBean.getInfo().getYundong().get(1);
//           //"洗车指数":
//                mLifeIndexCarWashTv.setText(lifeBean.getInfo().getXiche().get(0));
//                mLifeIndexCarWashDetail = lifeBean.getInfo().getXiche().get(1);
////            // "晾晒指数":
////                mLifeIndexAirCureTv.setText(index.getIndexValue());
////                mLifeIndexAirCureDetail = index.getIndexDetail();
//
////        }
//    }
//
//    /**
//     * 取得温度
//     *
//     * @param temp 温度信息
//     * @return 温度
//     */
//    private int getTemp(String temp) {
////        String temperature;
////        if (!temp.contains("-")) {
////            if (temp.length() == 6) {
////                temperature = temp.substring(3, 5);
////            } else {
////                temperature = temp.substring(3, 4);
////            }
////        } else {
////            if (temp.length() == 7) {
////                temperature = temp.substring(3, 6);
////            } else {
//////                temperature = temp.substring(3, 5);
////                temperature=temp;
////            }
////        }
//        return Integer.parseInt(temp);
//    }
////
//    /**
//     * 截取日期和星期
//     *
//     * @param date 日期信息
//     * @return 包含日期和星期的数组
//     */
//    private String[] getDay(WeatherInfoBean.ResultBean.DataBean.WeatherBean date) {
//        String[] date1 = new String[2];
//        date1[0] = date.getDate();
//        date1[1] = "周"+date.getWeek();
//        return date1;
//    }
////
////    /**
////     * 转换周的标题
////     *
////     * @param week 需要转换的周标题
////     * @return 周的标题
////     */
////    private String getWeek(String week) {
////        String week1;
////        switch (week) {
////            case "星期一":
////                week1 = getString(R.string.monday);
////                break;
////            case "星期二":
////                week1 = getString(R.string.tuesday);
////                break;
////            case "星期三":
////                week1 = getString(R.string.wednesday);
////                break;
////            case "星期四":
////                week1 = getString(R.string.thursday);
////                break;
////            case "星期五":
////                week1 = getString(R.string.friday);
////                break;
////            case "星期六":
////                week1 = getString(R.string.saturday);
////                break;
////            case "星期天":
////            case "星期日":
////                week1 = getString(R.string.sunday);
////                break;
////            default:
////                week1 = week;
////                break;
////        }
////        return week1;
////    }
////
//    /**
//     * 设置温度图片
//     *
//     * @param temp1     温度
//     * @param imageView imageView控件
//     */
//    private void setTemperatureImage(int temp1, ImageView imageView) {
//        switch (temp1) {
//            case 0:
//                imageView.setImageResource(R.drawable.weather_number_0);
//                break;
//            case 1:
//                imageView.setImageResource(R.drawable.weather_number_1);
//                break;
//            case 2:
//                imageView.setImageResource(R.drawable.weather_number_2);
//                break;
//            case 3:
//                imageView.setImageResource(R.drawable.weather_number_3);
//                break;
//            case 4:
//                imageView.setImageResource(R.drawable.weather_number_4);
//                break;
//            case 5:
//                imageView.setImageResource(R.drawable.weather_number_5);
//                break;
//            case 6:
//                imageView.setImageResource(R.drawable.weather_number_6);
//                break;
//            case 7:
//                imageView.setImageResource(R.drawable.weather_number_7);
//                break;
//            case 8:
//                imageView.setImageResource(R.drawable.weather_number_8);
//                break;
//            case 9:
//                imageView.setImageResource(R.drawable.weather_number_9);
//                break;
//            default:
//                imageView.setImageResource(R.drawable.weather_number_0);
//                break;
//        }
//    }
//
//    /**
//     * 初始化控件
//     *
//     * @param view view
//     */
//    private void init(View view) {
//        mWeatherGroup = (ViewGroup) view.findViewById(R.id.weather_layout);
//
//        swipeRefreshLayout = (SwipeRefreshLayout) view.findViewById(R.id.sw_refresh);
//        swipeRefreshLayout.setOnRefreshListener(getPresenter());
////        mProgressBar = (ViewGroup) view.findViewById(R.id.progress_bar_llyt);
////
////        mRefreshBtn = (ImageView) view.findViewById(R.id.action_refresh);
////        mRefreshBtn.setOnClickListener(this);
////        // HOME按钮
////        ImageView homeBtn = (ImageView) view.findViewById(R.id.action_home);
////        homeBtn.setOnClickListener(this);
////
////        mCityNameTv = (TextView) view.findViewById(R.id.action_title);
//        mAlarmTv = (TextView) view.findViewById(R.id.alarm);
//        mUpdateTimeTv = (TextView) view.findViewById(R.id.update_time);
//
//        mTemperature1Iv = (ImageView) view.findViewById(R.id.temperature1);
//        mTemperature2Iv = (ImageView) view.findViewById(R.id.temperature2);
//        mTemperature3Iv = (ImageView) view.findViewById(R.id.temperature3);
//        mWeatherTypeTv = (TextView) view.findViewById(R.id.weather_type);
//
//        mAqiTv = (RichDrawableText) view.findViewById(R.id.aqi);
//        mHumidityTv = (RichDrawableText) view.findViewById(R.id.humidity);
//        mWindTv = (RichDrawableText) view.findViewById(R.id.wind);
//
//        mWeatherTypeIvToday = (ImageView) view.findViewById(R.id.weather_type_iv_today);
//        mWeatherTypeIvTomorrow = (ImageView) view.findViewById(R.id.weather_type_iv_tomorrow);
//        mWeatherTypeIvDayAfterTomorrow = (ImageView) view.findViewById(R.id.weather_type_iv_day_after_tomorrow);
//
//        mTempHighTvToday = (TextView) view.findViewById(R.id.temp_high_today);
//        mTempHighTvTomorrow = (TextView) view.findViewById(R.id.temp_high_tomorrow);
//        mTempHighTvDayAfterTomorrow = (TextView) view.findViewById(R.id.temp_high_day_after_tomorrow);
//
//        mTempLowTvToday = (TextView) view.findViewById(R.id.temp_low_today);
//        mTempLowTvTomorrow = (TextView) view.findViewById(R.id.temp_low_tomorrow);
//        mTempLowTvDayAfterTomorrow = (TextView) view.findViewById(R.id.temp_low_day_after_tomorrow);
//
//        mWeatherTypeTvToday = (TextView) view.findViewById(R.id.weather_type_tv_today);
//        mWeatherTypeTvTomorrow = (TextView) view.findViewById(R.id.weather_type_tv_tomorrow);
//        mWeatherTypeTvDayAfterTomorrow = (TextView) view.findViewById(R.id.weather_type_tv_day_after_tomorrow);
//
////        mDaysForecastTvWeek1 = (TextView) view.findViewById(R.id.wea_days_forecast_week1);
//        mDaysForecastTvWeek2 = (TextView) view.findViewById(R.id.wea_days_forecast_week2);
//        mDaysForecastTvWeek3 = (TextView) view.findViewById(R.id.wea_days_forecast_week3);
//        mDaysForecastTvWeek4 = (TextView) view.findViewById(R.id.wea_days_forecast_week4);
//        mDaysForecastTvWeek5 = (TextView) view.findViewById(R.id.wea_days_forecast_week5);
//        mDaysForecastTvWeek6 = (TextView) view.findViewById(R.id.wea_days_forecast_week6);
//
////        mDaysForecastTvDay1 = (TextView) view.findViewById(R.id.wea_days_forecast_day1);
//        mDaysForecastTvDay2 = (TextView) view.findViewById(R.id.wea_days_forecast_day2);
//        mDaysForecastTvDay3 = (TextView) view.findViewById(R.id.wea_days_forecast_day3);
//        mDaysForecastTvDay4 = (TextView) view.findViewById(R.id.wea_days_forecast_day4);
//        mDaysForecastTvDay5 = (TextView) view.findViewById(R.id.wea_days_forecast_day5);
//        mDaysForecastTvDay6 = (TextView) view.findViewById(R.id.wea_days_forecast_day6);
//
////        mDaysForecastWeaTypeDayIv1 = (ImageView) view.findViewById(R.id.wea_days_forecast_weather_day_iv1);
//        mDaysForecastWeaTypeDayIv2 = (ImageView) view.findViewById(R.id.wea_days_forecast_weather_day_iv2);
//        mDaysForecastWeaTypeDayIv3 = (ImageView) view.findViewById(R.id.wea_days_forecast_weather_day_iv3);
//        mDaysForecastWeaTypeDayIv4 = (ImageView) view.findViewById(R.id.wea_days_forecast_weather_day_iv4);
//        mDaysForecastWeaTypeDayIv5 = (ImageView) view.findViewById(R.id.wea_days_forecast_weather_day_iv5);
//        mDaysForecastWeaTypeDayIv6 = (ImageView) view.findViewById(R.id.wea_days_forecast_weather_day_iv6);
//
////        mDaysForecastWeaTypeDayTv1 = (TextView) view.findViewById(R.id.wea_days_forecast_weather_day_tv1);
//        mDaysForecastWeaTypeDayTv2 = (TextView) view.findViewById(R.id.wea_days_forecast_weather_day_tv2);
//        mDaysForecastWeaTypeDayTv3 = (TextView) view.findViewById(R.id.wea_days_forecast_weather_day_tv3);
//        mDaysForecastWeaTypeDayTv4 = (TextView) view.findViewById(R.id.wea_days_forecast_weather_day_tv4);
//        mDaysForecastWeaTypeDayTv5 = (TextView) view.findViewById(R.id.wea_days_forecast_weather_day_tv5);
//        mDaysForecastWeaTypeDayTv6 = (TextView) view.findViewById(R.id.wea_days_forecast_weather_day_tv6);
//
//        mCharView = (LineChartViewDouble) view.findViewById(R.id.line_char);
//
////        mDaysForecastWeaTypeNightIv1 = (ImageView) view.findViewById(R.id.wea_days_forecast_weather_night_iv1);
//        mDaysForecastWeaTypeNightIv2 = (ImageView) view.findViewById(R.id.wea_days_forecast_weather_night_iv2);
//        mDaysForecastWeaTypeNightIv3 = (ImageView) view.findViewById(R.id.wea_days_forecast_weather_night_iv3);
//        mDaysForecastWeaTypeNightIv4 = (ImageView) view.findViewById(R.id.wea_days_forecast_weather_night_iv4);
//        mDaysForecastWeaTypeNightIv5 = (ImageView) view.findViewById(R.id.wea_days_forecast_weather_night_iv5);
//        mDaysForecastWeaTypeNightIv6 = (ImageView) view.findViewById(R.id.wea_days_forecast_weather_night_iv6);
//
////        mDaysForecastWeaTypeNightTv1 = (TextView) view.findViewById(R.id.wea_days_forecast_weather_night_tv1);
//        mDaysForecastWeaTypeNightTv2 = (TextView) view.findViewById(R.id.wea_days_forecast_weather_night_tv2);
//        mDaysForecastWeaTypeNightTv3 = (TextView) view.findViewById(R.id.wea_days_forecast_weather_night_tv3);
//        mDaysForecastWeaTypeNightTv4 = (TextView) view.findViewById(R.id.wea_days_forecast_weather_night_tv4);
//        mDaysForecastWeaTypeNightTv5 = (TextView) view.findViewById(R.id.wea_days_forecast_weather_night_tv5);
//        mDaysForecastWeaTypeNightTv6 = (TextView) view.findViewById(R.id.wea_days_forecast_weather_night_tv6);
//
////        mDaysForecastWindDirectionTv1 = (TextView) view.findViewById(R.id.wea_days_forecast_wind_direction_tv1);
//        mDaysForecastWindDirectionTv2 = (TextView) view.findViewById(R.id.wea_days_forecast_wind_direction_tv2);
//        mDaysForecastWindDirectionTv3 = (TextView) view.findViewById(R.id.wea_days_forecast_wind_direction_tv3);
//        mDaysForecastWindDirectionTv4 = (TextView) view.findViewById(R.id.wea_days_forecast_wind_direction_tv4);
//        mDaysForecastWindDirectionTv5 = (TextView) view.findViewById(R.id.wea_days_forecast_wind_direction_tv5);
//        mDaysForecastWindDirectionTv6 = (TextView) view.findViewById(R.id.wea_days_forecast_wind_direction_tv6);
//
////        mDaysForecastWindPowerTv1 = (TextView) view.findViewById(R.id.wea_days_forecast_wind_power_tv1);
//        mDaysForecastWindPowerTv2 = (TextView) view.findViewById(R.id.wea_days_forecast_wind_power_tv2);
//        mDaysForecastWindPowerTv3 = (TextView) view.findViewById(R.id.wea_days_forecast_wind_power_tv3);
//        mDaysForecastWindPowerTv4 = (TextView) view.findViewById(R.id.wea_days_forecast_wind_power_tv4);
//        mDaysForecastWindPowerTv5 = (TextView) view.findViewById(R.id.wea_days_forecast_wind_power_tv5);
//        mDaysForecastWindPowerTv6 = (TextView) view.findViewById(R.id.wea_days_forecast_wind_power_tv6);
//
//        mLifeIndexUmbrellaTv = (TextView) view.findViewById(R.id.wea_life_index_tv_umbrella);
//        mLifeIndexUltravioletRaysTv = (TextView) view.findViewById(R.id.wea_life_index_tv_ultraviolet_rays);
//        mLifeIndexDressTv = (TextView) view.findViewById(R.id.wea_life_tv_index_dress);
//        mLifeIndexColdTv = (TextView) view.findViewById(R.id.wea_life_index_tv_cold);
//        mLifeIndexMorningExerciseTv = (TextView) view.findViewById(R.id.wea_life_index_tv_morning_exercise);
//        mLifeIndexSportTv = (TextView) view.findViewById(R.id.wea_life_index_tv_sport);
//        mLifeIndexCarWashTv = (TextView) view.findViewById(R.id.wea_life_index_tv_car_wash);
//        mLifeIndexAirCureTv = (TextView) view.findViewById(R.id.wea_life_index_tv_air_cure);
//
//        // 雨伞指数控件
//        RelativeLayout lifeIndexUmbrellaRlyt = (RelativeLayout) view.findViewById(R.id.wea_life_index_rlyt_umbrella);
//        // 紫外线指数控件
//        RelativeLayout lifeIndexUltravioletRaysRlyt = (RelativeLayout) view.findViewById(R.id.wea_life_index_rlyt_ultraviolet_rays);
//        // 穿衣指数控件
//        RelativeLayout lifeIndexDressRlyt = (RelativeLayout) view.findViewById(R.id.wea_life_index_rlyt_dress);
//        // 感冒指数控件
//        RelativeLayout lifeIndexColdRlyt = (RelativeLayout) view.findViewById(R.id.wea_life_index_rlyt_cold);
//        // 晨练指数控件
//        RelativeLayout lifeIndexMorningExerciseRlyt = (RelativeLayout) view.findViewById(R.id.wea_life_index_rlyt_morning_exercise);
//        //  运动指数控件
//        RelativeLayout lifeIndexSportRlyt = (RelativeLayout) view.findViewById(R.id.wea_life_index_rlyt_sport);
//        // 洗车指数控件
//        RelativeLayout lifeIndexCarWashRlyt = (RelativeLayout) view.findViewById(R.id.wea_life_index_rlyt_carwash);
//        // 晾晒指数控件
//        RelativeLayout lifeIndexAirCureRlyt = (RelativeLayout) view.findViewById(R.id.wea_life_index_rlyt_air_cure);
//
//        //设置点击事件，弹出具体的详情
////        lifeIndexUmbrellaRlyt.setOnClickListener(this);
////        lifeIndexUltravioletRaysRlyt.setOnClickListener(this);
////        lifeIndexDressRlyt.setOnClickListener(this);
////        lifeIndexColdRlyt.setOnClickListener(this);
////        lifeIndexMorningExerciseRlyt.setOnClickListener(this);
////        lifeIndexSportRlyt.setOnClickListener(this);
////        lifeIndexCarWashRlyt.setOnClickListener(this);
////        lifeIndexAirCureRlyt.setOnClickListener(this);
//
//        mDensity = getResources().getDisplayMetrics().density;
//        mBlurDrawable = MyUtil.getWallPaperBlurDrawable(getActivity());
//        mBackGround = (LinearLayout) view.findViewById(R.id.wea_background);
//
////        mPullRefreshScrollView = (PullToRefreshScrollView) view
////                .findViewById(R.id.pull_refresh_scrollview);
////        // 设置下拉刷新
////        setPullToRefresh();
////        mPullRefreshScrollView.setScrollViewListener(new ScrollViewListener() {
////            @Override
////            public void onScrollChanged(ScrollView scrollView, int x, int y, int oldx, int oldy) {
//////                LogUtil.i(LOG_TAG, "x: " + x + "y: " + y + "oldx: " + oldx + "oldy: " + oldy);
////                // scroll最大滚动距离（xxxh：2320）/密度（xxxh：3）/1.5  =  515
////                mAlpha = Math.round(Math.round(y / mDensity / 1.5));
////                if (mAlpha > 255) {
////                    mAlpha = 255;
////                } else if (mAlpha < 0) {
////                    mAlpha = 0;
////                }
////                // 设置模糊处理后drawable的透明度
////                mBlurDrawable.setAlpha(mAlpha);
////                // 设置背景
////                //noinspection deprecation
////                mBackGround.setBackgroundDrawable(mBlurDrawable);
////            }
////        });
//    }
////
////    /**
////     * 设置下拉刷新
////     */
////
////    private void setPullToRefresh() {
////        mPullRefreshScrollView.getLoadingLayoutProxy().setPullLabel(getString(R.string.pull_to_refresh));
////        mPullRefreshScrollView.getLoadingLayoutProxy().setRefreshingLabel(
////                getString(R.string.refreshing));
////        mPullRefreshScrollView.getLoadingLayoutProxy().setReleaseLabel(getString(R.string.leave_to_refresh));
////        mPullRefreshScrollView
////                .setOnRefreshListener(new OnRefreshListener<ScrollView>() {
////
////                    @Override
////                    public void onRefresh(
////                            PullToRefreshBase<ScrollView> refreshView) {
////                        LogUtil.d(LOG_TAG, "  setPullToRefresh()");
////                        locationOrRefresh();
////                    }
////                });
////
////    }
////
////    @Override
////    public void onDestroy() {
////        super.onDestroy();
////        OttoAppConfig.getInstance().unregister(this);
////        mAlpha = 0;
////        if (mHandler != null) {
////            mHandler.removeCallbacks(mRun);
////        }
////    }
//}
